﻿UserManage = function(){
	
	this.field = "field";
	this.tbody = 'tbody';
	
	this.onDelete = function(objid,rowClass){
		alert(objid+":"+rowClass);
	};
	
	
	this.CreateTBody = function(json){
		for(var i = 0; i<json.length;i++){
			var objid_tr = HTML.createObjid();
			var objid_td = HTML.createObjid();
			
 			var tr = HTML.createTr(undefined,objid_tr);
 			var tds = SYSTEM.getFields('#thead tr:first td',this.field);
			var id = null;
 			for(var j = 0;j<tds.length;j++){
 				var td = HTML.createTd(undefined,objid_td);
 				if(tds[j]=="ID"&&id==null){
					id = json[i][tds[j]];
				}
 				if(tds[j]=='Manage'){
 					td.appendChild(HTML.createInput(undefined, "button", "del", "删除",
 							"new UserManage().onDelete('"+id+"','"+objid_td+"')"));
	 				tr.appendChild(td);
 					continue;
 				}
 				$(td).append(SYSTEM.trim(json[i][tds[j]]));
 				tr.appendChild(td);
			}
 			$("#"+this.tbody).append(tr);
 		}
	};
}